package com.springframework.DI_t.object_DI;

import com.springframework.DI_t.object_DI.bean.Dept;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class ObjectRun {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("com.springframework/DI_t/object_DI/bean.xml");
        Dept dept = context.getBean("dept",Dept.class);
        System.out.println(dept.getEmp().getDeptName()+","+dept.getEmp().getName());
        dept.getEmp().info();
        Dept dept1 = context.getBean("dept1",Dept.class);
        System.out.println(dept1.getEmp().getDeptName()+","+dept1.getEmp().getName());
        dept1.getEmp().info();
    }
}
